﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace EFCore.AspNet.Sample.Models
{
    public enum Grade
    {
        A, B, C, D, F
    }
    /// <summary>
    /// 导航实体
    /// 此实体使用 {classname}ID 模式而不是直接使用 ID。
    /// CourseID 属性是外键，其对应的导航属性为 Course。 Enrollment 实体与一个 Course 实体相关联
    /// </summary>
    public class Enrollment
    {
        public int EnrollmentID { get; set; }
        public int CourseID { get; set; }
        public int StudentID { get; set; }
        [DisplayFormat(NullDisplayText = "No grade")]
        public Grade? Grade { get; set; }
        public Course Course { get; set; }
        public Student Student { get; set; }
    }
}
